package demo3;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Demo {
    public static void main(String[] args) {
        UserDAO userdao=new UserDAO();
        System.out.println(userdao);


        AnnotationConfigApplicationContext context=
                new AnnotationConfigApplicationContext("demo3");
        UserDAO userdao1=context.getBean("userDAO",UserDAO.class);
        System.out.println(userdao1);

        Person person=context.getBean("person",Person.class);
        System.out.println(person);

        Person p1=context.getBean(Person.class);
        System.out.println(p1);
    }
}
